package de.wellenblau.textTracer
{
	import flash.display.Sprite;
	import flash.text.TextField;

	public class textTracer extends Sprite
	{
		
		private var txt:TextField;
		
		public function textTracer(w:int,h:int)
		{
			txt = new TextField();
			txt.width = w;
			txt.height = h;
			txt.selectable = false;
			addChild(txt);
		}
		
		public function set color(color:uint):void{
			txt.textColor = color;
		}
		
		public function set appendLine(line:String):void{
			if(txt.textHeight >= txt.height){
				txt.text = line+"\n";
			}
			else{
				txt.appendText(line+"\n");
			}
		}
		
		public function clear():void{
			txt.text=null;
		}
	}
}